package cn.tedu.review;
/**回顾继承*/
public class TestExtends {
    public static void main(String[] args) {
        ComputerStudent s1=new ComputerStudent(101,"杨超越",'女',59);
        MathStudent s2=new MathStudent(9,"张艺兴",'男',70);
        ChineseStudent s3=new ChineseStudent(5,"王一博",'男',100);
        s1.proClass();
        s1.hobby();
        s2.proClass();
        s2.hobby();
        s3.proClass();
        s3.hobby();

        Student s0=new Student(0,"蟹老板",'男',50);
        s0.thinkingClass();
    }

}
class Student{
    int sno;
    String name;
    char gender;
    double score;
    public void thinkingClass(){
        System.out.println("正在上思修课");
    }
    public void proClass(){
        System.out.println("正在上专业课");
    }

    public Student(int sno, String name, char gender, double score) {
        this.sno = sno;
        this.name = name;
        this.gender = gender;
        this.score = score;
    }
}
class ComputerStudent extends Student{
    public ComputerStudent(int sno, String name, char gender, double score) {
        super(sno, name, gender, score);
    }

    public void proClass(){
        System.out.println("正在上编程课");
    }
    public void hobby(){
        System.out.println("喜欢敲代码");
    }
}
class MathStudent extends Student{
    public MathStudent(int sno, String name, char gender, double score) {
        super(sno, name, gender, score);
    }


    @Override
    public void proClass(){
        System.out.println("正在上数学理论课");
    }
    public void hobby(){
        System.out.println("喜欢学模糊数学");
    }
}
class ChineseStudent extends Student{
    public ChineseStudent(int sno, String name, char gender, double score) {
        super(sno, name, gender, score);
    }

    @Override
    public void proClass(){
        System.out.println("正在上写作课");
    }
    public void hobby(){
        System.out.println("喜欢写小说");
    }
}